package com.ewo.ApplicationPageController.controller;

import com.ewo.entity.ApplicationPage.Estimate;
import com.ewo.entity.ResponseResult;
import com.ewo.service.ApplicationPage.EstimateService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/estimate")
@CrossOrigin("*")
public class EstimateController {

    @Resource
    EstimateService estimateService;

    //查找所有我的评价
    @GetMapping("/{empId}")
    public ResponseResult findEstimateByname(@PathVariable("empId") int empId){
        List<Estimate> estimateList = estimateService.findEstimateByEmpId(empId);
        if (estimateList == null || estimateList.size()==0){
            return ResponseResult.fail();
        }
        return ResponseResult.ok(estimateList);
    }


}
